//模块接口文件，暴露给外部模块使用
import { request } from "./request";
import METHOD from "./methods";
import URL from "./url";

const APIClient = {
    //将对象注入Vue全局
    // import API from "./utils/network/index";
    // //插件形式
    // Vue.use(API)
    install(Vue) {
        Vue.prototype.$API = this;
    },
    /**
     * 
     * @param {*} mobile String
     * @param {*} password  String
     * 
     */
    //登录
    login(mobile, password) {

        console.log(5555);
         return request(METHOD.POST, URL.LOGIN, { mobile: mobile, pwd: password }) },

    /**
     * 
     * @param {*} mobile 
     * @param {*} password 
     * @param {*} code 
     * @param {*} nikcname 
     */
    //   注册
    register(mobile, password, code, nikcname) { return request(METHOD.POST, URL.REGISTER, { mobile: mobile, pwd: password, code: code, nikcname: nikcname }) }

}

export default APIClient;
